{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "687fa718",
   "metadata": {},
   "outputs": [],
   "source": [
    "import warnings\n",
    "warnings.filterwarnings('ignore')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "7b2593ce",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import gc\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import re\n",
    "import time\n",
    "from scipy import stats\n",
    "import matplotlib.pyplot as plt\n",
    "import category_encoders as ce\n",
    "import networkx as nx\n",
    "import pickle\n",
    "import lightgbm as lgb\n",
    "import catboost as cat\n",
    "import xgboost as xgb\n",
    "from datetime import timedelta\n",
    "from gensim.models import Word2Vec\n",
    "from io import StringIO\n",
    "from tqdm import tqdm\n",
    "from lightgbm import LGBMClassifier\n",
    "from lightgbm import log_evaluation, early_stopping\n",
    "from sklearn.metrics import roc_curve\n",
    "from scipy.stats import chi2_contingency, pearsonr\n",
    "from sklearn.preprocessing import StandardScaler, OneHotEncoder, LabelEncoder\n",
    "from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer\n",
    "from sklearn.feature_extraction import FeatureHasher\n",
    "from sklearn.model_selection import StratifiedKFold, KFold, train_test_split, GridSearchCV\n",
    "from category_encoders import TargetEncoder\n",
    "from sklearn.decomposition import TruncatedSVD\n",
    "from autogluon.tabular import TabularDataset, TabularPredictor, FeatureMetadata\n",
    "from autogluon.features.generators import AsTypeFeatureGenerator, BulkFeatureGenerator, DropUniqueFeatureGenerator, FillNaFeatureGenerator, PipelineFeatureGenerator\n",
    "from autogluon.features.generators import CategoryFeatureGenerator, IdentityFeatureGenerator, AutoMLPipelineFeatureGenerator\n",
    "from autogluon.common.features.types import R_INT, R_FLOAT\n",
    "from autogluon.core.metrics import make_scorer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "24fcc209",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Package                   Version\n",
      "------------------------- -----------\n",
      "anyio                     4.10.0\n",
      "argon2-cffi               21.3.0\n",
      "argon2-cffi-bindings      25.1.0\n",
      "asttokens                 3.0.0\n",
      "async-lru                 2.0.4\n",
      "attrs                     24.3.0\n",
      "autogluon.common          1.3.1\n",
      "autogluon.core            1.3.1\n",
      "autogluon.features        1.3.1\n",
      "autogluon.tabular         1.3.1\n",
      "babel                     2.16.0\n",
      "beautifulsoup4            4.13.5\n",
      "bleach                    6.2.0\n",
      "boto3                     1.40.52\n",
      "botocore                  1.40.52\n",
      "brotlicffi                1.0.9.2\n",
      "catboost                  1.2.8\n",
      "category_encoders         2.8.1\n",
      "certifi                   2025.10.5\n",
      "cffi                      2.0.0\n",
      "charset-normalizer        3.3.2\n",
      "click                     8.3.0\n",
      "cloudpickle               3.1.1\n",
      "colorama                  0.4.6\n",
      "comm                      0.2.1\n",
      "contourpy                 1.3.2\n",
      "cycler                    0.12.1\n",
      "dask                      2025.10.0\n",
      "debugpy                   1.8.16\n",
      "decorator                 5.2.1\n",
      "defusedxml                0.7.1\n",
      "exceptiongroup            1.2.0\n",
      "executing                 2.2.1\n",
      "fastjsonschema            2.20.0\n",
      "fonttools                 4.60.1\n",
      "fsspec                    2025.9.0\n",
      "gensim                    4.3.3\n",
      "graphviz                  0.21\n",
      "h11                       0.16.0\n",
      "httpcore                  1.0.9\n",
      "httpx                     0.28.1\n",
      "idna                      3.7\n",
      "importlib_metadata        8.7.0\n",
      "ipykernel                 6.30.1\n",
      "ipython                   8.30.0\n",
      "jedi                      0.19.2\n",
      "Jinja2                    3.1.6\n",
      "jmespath                  1.0.1\n",
      "joblib                    1.5.2\n",
      "json5                     0.9.25\n",
      "jsonschema                4.25.0\n",
      "jsonschema-specifications 2023.7.1\n",
      "jupyter_client            8.6.3\n",
      "jupyter_core              5.8.1\n",
      "jupyter-events            0.12.0\n",
      "jupyter-lsp               2.2.5\n",
      "jupyter_server            2.16.0\n",
      "jupyter_server_terminals  0.5.3\n",
      "jupyterlab                4.4.7\n",
      "jupyterlab_pygments       0.3.0\n",
      "jupyterlab_server         2.27.3\n",
      "kiwisolver                1.4.9\n",
      "lightgbm                  4.6.0\n",
      "locket                    1.0.0\n",
      "MarkupSafe                3.0.2\n",
      "matplotlib                3.10.7\n",
      "matplotlib-inline         0.1.7\n",
      "mistune                   3.1.2\n",
      "narwhals                  2.8.0\n",
      "nbclient                  0.10.2\n",
      "nbconvert                 7.16.6\n",
      "nbformat                  5.10.4\n",
      "nest-asyncio              1.6.0\n",
      "networkx                  3.4.2\n",
      "notebook                  7.4.5\n",
      "notebook_shim             0.2.4\n",
      "numpy                     1.26.4\n",
      "overrides                 7.4.0\n",
      "packaging                 25.0\n",
      "pandas                    2.2.3\n",
      "pandocfilters             1.5.1\n",
      "parso                     0.8.4\n",
      "partd                     1.4.2\n",
      "patsy                     1.0.1\n",
      "pillow                    11.3.0\n",
      "pip                       25.2\n",
      "platformdirs              4.3.7\n",
      "plotly                    6.3.1\n",
      "prometheus_client         0.21.1\n",
      "prompt_toolkit            3.0.52\n",
      "psutil                    7.0.0\n",
      "pure_eval                 0.2.3\n",
      "pycparser                 2.23\n",
      "Pygments                  2.19.1\n",
      "pyparsing                 3.2.5\n",
      "PySocks                   1.7.1\n",
      "python-dateutil           2.9.0.post0\n",
      "python-json-logger        3.2.1\n",
      "pytz                      2025.2\n",
      "pywin32                   311\n",
      "pywinpty                  2.0.15\n",
      "PyYAML                    6.0.2\n",
      "pyzmq                     27.1.0\n",
      "referencing               0.30.2\n",
      "requests                  2.32.5\n",
      "rfc3339-validator         0.1.4\n",
      "rfc3986-validator         0.1.1\n",
      "rpds-py                   0.22.3\n",
      "s3transfer                0.14.0\n",
      "scikit-learn              1.6.1\n",
      "scipy                     1.13.1\n",
      "Send2Trash                1.8.2\n",
      "setuptools                80.9.0\n",
      "six                       1.17.0\n",
      "smart_open                7.3.1\n",
      "sniffio                   1.3.0\n",
      "soupsieve                 2.5\n",
      "stack_data                0.6.3\n",
      "statsmodels               0.14.5\n",
      "terminado                 0.18.1\n",
      "threadpoolctl             3.6.0\n",
      "tinycss2                  1.4.0\n",
      "tomli                     2.2.1\n",
      "toolz                     1.0.0\n",
      "tornado                   6.5.1\n",
      "tqdm                      4.67.1\n",
      "traitlets                 5.14.3\n",
      "typing_extensions         4.15.0\n",
      "tzdata                    2025.2\n",
      "urllib3                   2.5.0\n",
      "wcwidth                   0.2.13\n",
      "webencodings              0.5.1\n",
      "websocket-client          1.8.0\n",
      "wheel                     0.45.1\n",
      "win-inet-pton             1.1.0\n",
      "wrapt                     1.17.3\n",
      "xgboost                   3.0.5\n",
      "zipp                      3.23.0\n"
     ]
    }
   ],
   "source": [
    "!pip list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "b8374e84",
   "metadata": {},
   "outputs": [],
   "source": [
    "def load_data_from_directory(directory):\n",
    "    \"\"\"\n",
    "    遍历目录加载所有CSV文件，将其作为独立的DataFrame变量\n",
    "\n",
    "    参数:\n",
    "    - directory: 输入的数据路径\n",
    "    \n",
    "    返回:\n",
    "    - 含有数据集名称的列表\n",
    "    \"\"\"\n",
    "    dataset_names = []\n",
    "    for filename in os.listdir(directory):\n",
    "        if filename.endswith(\".csv\"):\n",
    "            dataset_name = os.path.splitext(filename)[0] + '_data' # 获取文件名作为变量名\n",
    "            file_path = os.path.join(directory, filename)  # 完整的文件路径\n",
    "            globals()[dataset_name] = pd.read_csv(file_path)  # 将文件加载为DataFrame并赋值给全局变量\n",
    "            dataset_names.append(dataset_name)\n",
    "            print(f\"数据集 {dataset_name} 已加载为 DataFrame\")\n",
    "\n",
    "    return dataset_names"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "1544a12c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "数据集 train_aget_pay_data 已加载为 DataFrame\n",
      "数据集 train_asset_data 已加载为 DataFrame\n",
      "数据集 train_ccd_tr_dtl_data 已加载为 DataFrame\n",
      "数据集 train_mb_qrytrnflw_test_01_data 已加载为 DataFrame\n",
      "数据集 train_mb_qrytrnflw_test_02_data 已加载为 DataFrame\n",
      "数据集 train_mb_trnflw_data 已加载为 DataFrame\n",
      "数据集 train_nature_data 已加载为 DataFrame\n",
      "数据集 train_pageview_dtl_test_01_data 已加载为 DataFrame\n",
      "数据集 train_pageview_dtl_test_02_data 已加载为 DataFrame\n",
      "数据集 train_prod_hold_data 已加载为 DataFrame\n",
      "数据集 train_target_info_data 已加载为 DataFrame\n",
      "数据集 train_tr_aps_dtl_test_01_data 已加载为 DataFrame\n",
      "数据集 train_tr_aps_dtl_test_02_data 已加载为 DataFrame\n",
      "数据集 train_tr_ibtf_data 已加载为 DataFrame\n",
      "数据集 train_tr_tpay_data 已加载为 DataFrame\n"
     ]
    }
   ],
   "source": [
    "train_load_dt = '../Train_Data'\n",
    "train_data_name = load_data_from_directory(train_load_dt)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ceba707c",
   "metadata": {},
   "source": [
    "# 数据探查"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "b0b22f8c",
   "metadata": {},
   "outputs": [],
   "source": [
    "qrytrnflw_test_01 = pd.read_csv('../Train_Data/train_mb_qrytrnflw_test_01.csv')\n",
    "qrytrnflw_test_02 = pd.read_csv('../Train_Data/train_mb_qrytrnflw_test_02.csv')\n",
    "trApsdtl_01 = pd.read_csv('../Train_Data/train_tr_aps_dtl_test_01.csv')\n",
    "trApsdtl_02 = pd.read_csv('../Train_Data/train_tr_aps_dtl_test_02.csv')\n",
    "pageView_dtl_01 = pd.read_csv('../Train_Data/train_pageview_dtl_test_01.csv')\n",
    "pageView_dtl_02 = pd.read_csv('../Train_Data/train_pageview_dtl_test_02.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "407f574b",
   "metadata": {},
   "outputs": [],
   "source": [
    "pageView_dtl = pd.concat([pageView_dtl_01, pageView_dtl_02], axis=0).reset_index(drop=True)\n",
    "trApsdtl = pd.concat([trApsdtl_01, trApsdtl_02], axis=0).reset_index(drop=True)\n",
    "qrytrnflw = pd.concat([qrytrnflw_test_01, qrytrnflw_test_02], axis=0).reset_index(drop=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "609faddd",
   "metadata": {},
   "outputs": [],
   "source": [
    "pageView_dtl.to_csv('../Train_Data/TRAIN_MB_PAGEVIEW_DTL.csv', index=False)\n",
    "trApsdtl.to_csv('../Train_Data/TRAIN_TR_APS_DTL.csv', index=False)\n",
    "qrytrnflw.to_csv('../Train_Data/TRAIN_MB_QRYTRNFLW.csv', index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c296d59c",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "fbf2a432",
   "metadata": {},
   "outputs": [],
   "source": [
    "pageView_dtl_01 = pd.read_csv('../DATA/A_pageview_dtl_test_01.csv')\n",
    "pageView_dtl_02 = pd.read_csv('../DATA/A_pageview_dtl_test_02.csv')\n",
    "trApsdtl_01 = pd.read_csv('../DATA/A_tr_aps_dtl_test_01.csv')\n",
    "trApsdtl_02 = pd.read_csv('../DATA/A_tr_aps_dtl_test_02.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "22987933",
   "metadata": {},
   "outputs": [],
   "source": [
    "pageView_dtl = pd.concat([pageView_dtl_01, pageView_dtl_02], axis=0).reset_index(drop=True)\n",
    "trApsdtl = pd.concat([trApsdtl_01, trApsdtl_02], axis=0).reset_index(drop=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "28fdcc7a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>OPERATION_DATE</th>\n",
       "      <th>md5(CUST_NO)</th>\n",
       "      <th>PAGE_TITLE</th>\n",
       "      <th>REFERRER_TITLE</th>\n",
       "      <th>MODEL_NAME</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2025-04-07</td>\n",
       "      <td>864a14a62ffffbc4741d365ea5a08278</td>\n",
       "      <td>dc127d306179477fef4f3a9378dc550b</td>\n",
       "      <td>0e5c9561153e8b3fd936b94a5641c8e1</td>\n",
       "      <td>c5b386b7a6348a2f1ba70f2259fb827e</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2025-04-07</td>\n",
       "      <td>864a14a62ffffbc4741d365ea5a08278</td>\n",
       "      <td>0e5c9561153e8b3fd936b94a5641c8e1</td>\n",
       "      <td>c5b386b7a6348a2f1ba70f2259fb827e</td>\n",
       "      <td>c5b386b7a6348a2f1ba70f2259fb827e</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2025-04-07</td>\n",
       "      <td>864a14a62ffffbc4741d365ea5a08278</td>\n",
       "      <td>a3efea933884689e89b46cadd9aa989e</td>\n",
       "      <td>dc127d306179477fef4f3a9378dc550b</td>\n",
       "      <td>c5b386b7a6348a2f1ba70f2259fb827e</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2025-04-07</td>\n",
       "      <td>74dfe9a67327540d1f427b40e85d49c7</td>\n",
       "      <td>dc127d306179477fef4f3a9378dc550b</td>\n",
       "      <td>a3efea933884689e89b46cadd9aa989e</td>\n",
       "      <td>c5b386b7a6348a2f1ba70f2259fb827e</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2025-04-07</td>\n",
       "      <td>74dfe9a67327540d1f427b40e85d49c7</td>\n",
       "      <td>dc127d306179477fef4f3a9378dc550b</td>\n",
       "      <td>c5b386b7a6348a2f1ba70f2259fb827e</td>\n",
       "      <td>c5b386b7a6348a2f1ba70f2259fb827e</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  OPERATION_DATE                      md5(CUST_NO)  \\\n",
       "0     2025-04-07  864a14a62ffffbc4741d365ea5a08278   \n",
       "1     2025-04-07  864a14a62ffffbc4741d365ea5a08278   \n",
       "2     2025-04-07  864a14a62ffffbc4741d365ea5a08278   \n",
       "3     2025-04-07  74dfe9a67327540d1f427b40e85d49c7   \n",
       "4     2025-04-07  74dfe9a67327540d1f427b40e85d49c7   \n",
       "\n",
       "                         PAGE_TITLE                    REFERRER_TITLE  \\\n",
       "0  dc127d306179477fef4f3a9378dc550b  0e5c9561153e8b3fd936b94a5641c8e1   \n",
       "1  0e5c9561153e8b3fd936b94a5641c8e1  c5b386b7a6348a2f1ba70f2259fb827e   \n",
       "2  a3efea933884689e89b46cadd9aa989e  dc127d306179477fef4f3a9378dc550b   \n",
       "3  dc127d306179477fef4f3a9378dc550b  a3efea933884689e89b46cadd9aa989e   \n",
       "4  dc127d306179477fef4f3a9378dc550b  c5b386b7a6348a2f1ba70f2259fb827e   \n",
       "\n",
       "                         MODEL_NAME  \n",
       "0  c5b386b7a6348a2f1ba70f2259fb827e  \n",
       "1  c5b386b7a6348a2f1ba70f2259fb827e  \n",
       "2  c5b386b7a6348a2f1ba70f2259fb827e  \n",
       "3  c5b386b7a6348a2f1ba70f2259fb827e  \n",
       "4  c5b386b7a6348a2f1ba70f2259fb827e  "
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pageView_dtl.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "9e1a472b",
   "metadata": {},
   "outputs": [],
   "source": [
    "pageView_dtl.rename(columns={'md5(CUST_NO)': 'CUST_NO'}, inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "0bfa94cc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>OPERATION_DATE</th>\n",
       "      <th>CUST_NO</th>\n",
       "      <th>PAGE_TITLE</th>\n",
       "      <th>REFERRER_TITLE</th>\n",
       "      <th>MODEL_NAME</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2025-04-07</td>\n",
       "      <td>864a14a62ffffbc4741d365ea5a08278</td>\n",
       "      <td>dc127d306179477fef4f3a9378dc550b</td>\n",
       "      <td>0e5c9561153e8b3fd936b94a5641c8e1</td>\n",
       "      <td>c5b386b7a6348a2f1ba70f2259fb827e</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2025-04-07</td>\n",
       "      <td>864a14a62ffffbc4741d365ea5a08278</td>\n",
       "      <td>0e5c9561153e8b3fd936b94a5641c8e1</td>\n",
       "      <td>c5b386b7a6348a2f1ba70f2259fb827e</td>\n",
       "      <td>c5b386b7a6348a2f1ba70f2259fb827e</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2025-04-07</td>\n",
       "      <td>864a14a62ffffbc4741d365ea5a08278</td>\n",
       "      <td>a3efea933884689e89b46cadd9aa989e</td>\n",
       "      <td>dc127d306179477fef4f3a9378dc550b</td>\n",
       "      <td>c5b386b7a6348a2f1ba70f2259fb827e</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2025-04-07</td>\n",
       "      <td>74dfe9a67327540d1f427b40e85d49c7</td>\n",
       "      <td>dc127d306179477fef4f3a9378dc550b</td>\n",
       "      <td>a3efea933884689e89b46cadd9aa989e</td>\n",
       "      <td>c5b386b7a6348a2f1ba70f2259fb827e</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2025-04-07</td>\n",
       "      <td>74dfe9a67327540d1f427b40e85d49c7</td>\n",
       "      <td>dc127d306179477fef4f3a9378dc550b</td>\n",
       "      <td>c5b386b7a6348a2f1ba70f2259fb827e</td>\n",
       "      <td>c5b386b7a6348a2f1ba70f2259fb827e</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  OPERATION_DATE                           CUST_NO  \\\n",
       "0     2025-04-07  864a14a62ffffbc4741d365ea5a08278   \n",
       "1     2025-04-07  864a14a62ffffbc4741d365ea5a08278   \n",
       "2     2025-04-07  864a14a62ffffbc4741d365ea5a08278   \n",
       "3     2025-04-07  74dfe9a67327540d1f427b40e85d49c7   \n",
       "4     2025-04-07  74dfe9a67327540d1f427b40e85d49c7   \n",
       "\n",
       "                         PAGE_TITLE                    REFERRER_TITLE  \\\n",
       "0  dc127d306179477fef4f3a9378dc550b  0e5c9561153e8b3fd936b94a5641c8e1   \n",
       "1  0e5c9561153e8b3fd936b94a5641c8e1  c5b386b7a6348a2f1ba70f2259fb827e   \n",
       "2  a3efea933884689e89b46cadd9aa989e  dc127d306179477fef4f3a9378dc550b   \n",
       "3  dc127d306179477fef4f3a9378dc550b  a3efea933884689e89b46cadd9aa989e   \n",
       "4  dc127d306179477fef4f3a9378dc550b  c5b386b7a6348a2f1ba70f2259fb827e   \n",
       "\n",
       "                         MODEL_NAME  \n",
       "0  c5b386b7a6348a2f1ba70f2259fb827e  \n",
       "1  c5b386b7a6348a2f1ba70f2259fb827e  \n",
       "2  c5b386b7a6348a2f1ba70f2259fb827e  \n",
       "3  c5b386b7a6348a2f1ba70f2259fb827e  \n",
       "4  c5b386b7a6348a2f1ba70f2259fb827e  "
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pageView_dtl.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "bf8c784a",
   "metadata": {},
   "outputs": [],
   "source": [
    "pageView_dtl.to_csv('../DATA/MB_PAGEVIEW_DTL.csv', index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "5b63e3cc",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 345313 entries, 0 to 345312\n",
      "Data columns (total 6 columns):\n",
      " #   Column     Non-Null Count   Dtype  \n",
      "---  ------     --------------   -----  \n",
      " 0   APSDTRDAT  345313 non-null  int64  \n",
      " 1   CUST_NO    345313 non-null  object \n",
      " 2   APSDTRCOD  345313 non-null  object \n",
      " 3   APSDTRAMT  345313 non-null  float64\n",
      " 4   APSDABS    345313 non-null  object \n",
      " 5   APSDTRCHL  345313 non-null  object \n",
      "dtypes: float64(1), int64(1), object(4)\n",
      "memory usage: 15.8+ MB\n"
     ]
    }
   ],
   "source": [
    "trApsdtl.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "749a1e3f",
   "metadata": {},
   "outputs": [],
   "source": [
    "trApsdtl.to_csv('../DATA/TR_APS_DTL.csv', index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c06ef747",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "starcup",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.18"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
